import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
    state: {
        porjectObject: {},
        porjectTree: {},
        // porjectBoardTree: {},
        wxUserId: '',
        wxUserDate: '',
        ModalArr: [],
        flag: true,
        flvItem: {},
        flvIndex: '',
        fence: {},
        ModalPage: [],
        ModalChildPage: [],
        equipModalList: [],
        isCollapseFlag: false,
        ruleList: [],
        sliderId: "",
        //设置米多数据大屏 tab切换，1-图片、2-视频、3-地图、4-模型
        boardMdTabActive:1,
        // 数据看板-视频监控缓存数据
        fimCacheData:{
            // 布局id
            layoutId:'',
            // 缓存数据
            cacheVideoPlayList:[],
        },
        msgExpend: true,//信息页面二级菜单折叠状态
        msgNum:0,//首页信息数量
    },
    mutations: {
        // 设置数据看板-视频监控缓存数据
        setFimCacheData(state,params){
            state.fimCacheData = params;
        },
        //设置米多数据大屏 tab切换，1-图片、2-视频、3-地图、4-模型
        setBoardMdTabActive(state, params) {
            state.boardMdTabActive = params;
        },
        setequipModalList(state, parmas) {
            state.equipModalList = parmas;
        },
        setPorjectObject(state, parmas) {
            state.porjectObject = parmas;
        },
        /* 暂时没有用到 */
        // setPorjectBoardTree(state, parmas) {
        //     state.porjectBoardTree = parmas;
        // },
        setPorjectTree(state, parmas) {
            state.porjectTree = parmas;
        },
        setwxUserId(state, parmas) {
            state.wxUserId = parmas;
        },
        setSliderId(state, parmas) {
            state.sliderId = parmas;
        },
        setUserDate(state, parmas) {
            state.wxUserDate = parmas;
        },
        setModalArr(state, parmas) {
            state.ModalArr = parmas;
        },
        setModalPage(state, parmas) {
            state.ModalPage = parmas;
        },
        setRuleList(state, parmas) {
            state.ruleList = parmas;
        },
        // setFlag(state, parmas) {
        //     state.flag = parmas;
        // },
        setflvItem(state, parmas) {
            state.flvItem = parmas;
        },
        setFlvIndex(state, parmas) {
            state.flvIndex = parmas;
        },
        setFence(state, parmas) {
            state.fence = parmas;
        },
        setModalChildPage(state, parmas) {
            state.ModalChildPage = parmas;
        },
        setIsCollapseFlag(state, parmas) {
            state.isCollapseFlag = parmas;
        },
        setMsgExpend(state, params) {
            state.msgExpend = params;
        },
        setMsgNum(state, params) {
            state.msgNum = params;
        },
    },
    actions:{
        actFimCacheData(context,params){
            context.commit('setFimCacheData',params);
        },
    }
})
